<extend name="layout/edit" />

<block name="HEADER">
	
</block>

<block name="CONTENT">
	<control:grid id="grid" padding="0" height="100%" />
</block>

<block name="FOOTER">
	<script type="text/javascript">
		var page = (function(ns){
     
		    //页面初始化
		    ns.init=function(){
		        grid.load([]);
		    }
		    
		    
		    //新增
		    ns.add=function(){
		    	var filter = {
		            url:"modules/shop/auth/edit",
		            oid:"",
		            mode:1
		        }
		        $.openIframe(filter, "新增",['550px', '380px']);
		    }
		    
		    //编辑
		    ns.edit=function(){
		    	var selectedRow = grid.getSelectedRows()[0];
		        var filter = {
		            url:"modules/shop/auth/edit",
		            oid: selectedRow.id ,
		            mode:2
		        }
		        $.openIframe(filter, "编辑",['550px', '380px']);
		    }  
		    
		    //删除
		    ns.del =function(){
		    	grid.deleteSelectRow();
		    }
		    
		    //下拉移动  type: 1 = 上移 ,  type: 2 = 下移
		    ns.setShow = function(id,type){
		    	grid.updateField(id,'is_show',type);
		    }
		    
		    return ns;
		}({}));
		
		
		$(function(){ page.init();  });

	</script>
</block>